#pragma once
#include "loadUtils.h"

/**
 * @brief Struct for storing plantilla data
 */
struct PlantillaVars{
	int userID;
	int plantillaID;
	char name[31];
	int budget;
	int points;
};

/**
 * @brief keeps count of how many plantillas there are, also used for memory reallocation
 */
extern int plantillacount;

/**
 * @brief Load plantilla file into memory
 *
 * @param filename
 *
 * @param pata_ptr pointer to allocated memory
 *
 * @return return code
 */
int loadPlantillas(char const *filename,struct PlantillaVars **data_ptr);

/**
 * @brief save plantilladata to file
 *
 * @param filename
 *
 * @param pata_ptr pointer to allocated memory
 *
 * @return return code
 */
int writePlantillas(char const *filename,struct PlantillaVars *data);

/**
 * @brief add a plantilla to the vector, reallocates if needed
 *
 * @param pata_ptr pointer to allocated memory
 *
 * @param n
 */
void addPlantilla(struct PlantillaVars n,struct PlantillaVars **data_ptr);

/**
 * @brief removes a plantilla by index
 *
 * @param pata_ptr pointer to allocated memory
 *
 * @param index
 */
void rmPlantilla(int index,struct PlantillaVars **data_ptr);
